package com.five.service.Impl;

import com.five.dao.reviewDao;
import com.five.pojo.review;
import com.five.service.reviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class reviewServiceImpl implements reviewService {
    @Autowired
    reviewDao reviewDao;

    @Override
    public List<review> getById(Integer actId) {
        List<review> reviewList = reviewDao.getById(actId);
        return reviewList;
    }

    @Override
    public void addReview(review review) {
        review.setReTime(LocalDateTime.now());
        review.setStatus(0);
        reviewDao.addReview(review);
    }
}
